import React, { useState } from 'react'
import { Table } from 'antd'
import { keyList } from './mock'
const Index = () => {
  const [state, setState] = useState(['false'])
  const columns = () => {
    return [
      {
        title: '姓名',
        dataIndex: 'name',
        key: 'name',
      },
      {
        title: '年龄',
        dataIndex: 'age',
        key: 'age',
        filterMultiple: false,

        filters: [
          {
            text: 'true',
            value: true,
          },
          {
            text: 'false',
            value: false,
          },
        ],
      },
      {
        title: '住址',
        dataIndex: 'address',
        key: 'address',
        filterDropdown: () => {
          return <div>2</div>
        },
      },
    ]
  }
  return (
    <div>
      <div>可控筛选</div>
      <Table
        onChange={(v, i, r) => {
          console.log('222', v)
          console.log('333', i)
          console.log('444', r)
        }}
        dataSource={keyList}
        columns={columns()}
      />
    </div>
  )
}
export default Index
